<!DOCTYPE html> 
<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <title>基本信息</title> 
    <link href="css/base.css" rel="stylesheet">
    <link rel="stylesheet" href="jquery-easyui-1.5.3/themes/default/easyui.css">
    <link href="jquery-easyui-1.5.3/themes/icon.css" rel="stylesheet">
    <link href="css/basic_info.css" rel="stylesheet">
    <link rel="stylesheet" href="css/xk.css">
    <script type="text/javascript" src="font_jjkmvgsdpk/iconfont.js"></script>
    <link rel="stylesheet" href="font_jjkmvgsdpk/iconfont.css">
    <link href="css/process.css" rel="stylesheet">
</head> 
<body>
 <div class="container">
  <div class="xk_submit" style="height: 24px;background-color: #eeeeee;bottom: 0;left: 0;right: 0;position: fixed;text-align: center;">
    <button class="easyui-linkbutton" type="button" iconCls="icon-save" style="height: 24px;margin-left: 5px;">保存</button>
    <button class="easyui-linkbutton" type="button" id="jzxxfy" iconCls="icon-large-clipart" style="height: 24px;margin-left: 5px;">打印</button>
  </div>
  <div class="content">
   <div style="margin-left: 1%;background: linear-gradient(to bottom,#ffffff 0,#F2F2F2 100%);height: 28px;line-height: 28px;border: 1px solid #CCCCCC;padding-left: 5px;">
    <ul id="a_bian"> 
     <li style="float: left;"><span>基本信息</span>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
     <li style="float: left;"><a href="stbmxx"><span>尸表检验</span></a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
     <li style="float: left;"><a href="stjpxx"><span>解剖检验</span></a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
     <li style="float: left;"><a href="stzpxx"><span>尸检照片</span></a></li>
    </ul>
   </div> 
   <form>
   <div class="column"><span class="current">尸检基本信息</span></div> 
   <table class="xk_table">
     <tr>
       <td class="xk_label" colspan="6">尸体编号:J5000000000002019030001<a href="stjdxx">简单信息录用录入</a></td>
     </tr> 
     <tr>
      <td class="xk_label">委托单位<font>*</font></td>
      <td style="width: 25%;">
       <input type="text" class="xk_input" name="consignedAgency" style="width: 90%;">
      </td>
      <td colspan="4"></td>
     </tr>
     <tr>
      <td class="xk_label">委托人<font>*</font></td>
      <td style="width: 25%;">
       <input type="text" class="xk_input" name="consignedBy" style="width: 90%;">
      </td>
      <td class="xk_label">联系电话<font>*</font></td>
      <td style="width: 25%;">
       <input type="text" class="xk_input" name="consignerPhone" style="width: 90%;">
      </td>
      <td colspan="2"></td>
     </tr>
     <tr>
       <td class="xk_label">委托时间<font>*</font></td>
      <td style="width: 25%;">
       <input type="text" class="xk_input" name="consignedDate" style="width: 90%;">
      </td>
      <td colspan="4"></td>
     </tr>
     <tr>
       <td class="xk_label">检验单位<font>*</font></td>
      <td style="width: 25%;">
       <input type="text" class="xk_input" name="examinedAgency" style="width: 90%;">
      </td>
      <td colspan="4"></td>
     </tr>
     <tr>
      <td class="xk_label">检验日期(起)<font>*</font></td>
      <td style="width: 25%;">
       <input type="text" class="xk_input" name="examinedDateup" style="width: 90%;">
      </td>
      <td class="xk_label">检验日期(止)<font>*</font></td>
      <td style="width: 25%;">
       <input type="text" class="xk_input" name="examinedDatedown" style="width: 90%;">
      </td>
      <td colspan="2"></td>
     </tr>
     <tr>
      <td class="xk_label">检验人<font>*</font></td>
      <td style="width: 25%;" colspan="4">
       <input type="text" class="xk_input" name="examinedBy" id="jyr_val" key="" readonly="readonly" style="width: 90%;">
       <svg class="icon" aria-hidden="true" id="jyr">
        <use xlink:href="#icon-shujuzidian"></use>
       </svg> 
      </td>
     </tr>
     <tr>
      <td class="xk_label">检验地点<font>*</font></td>
      <td style="width: 25%;" colspan="4">
       <input type="text" class="xk_input" name="examinedPlace" style="width: 90%;">
      </td>
     </tr>
     <tr>
      <td class="xk_label_textarea">勘验事由<font>*</font></td>
      <td colspan="5"><textarea type="text" class="xk_input_textarea" name=""></textarea></td>
     </tr>
     <tr>
      <td class="xk_label" rowspan="5">死者</td>
      <td style="height: 28px;" colspan="5"><span style="margin-left: 10px;">姓名：</span><input style="width: 8%;" type="text" class="xk_input" name="name">
        <span>性别：</span><input type="text" style="width: 8%;" class="xk_input" name="sex">
        <span>出生日期：</span><input type="text" style="width: 8%;" class="xk_input" name="birthDate">
      </td>
     </tr>
     <tr>
      <td style="height: 28px;" colspan="5"><span style="margin-left: 10px;">国籍：</span><input style="width: 8%;" type="text" id="gj_val" key="" readonly="readonly" class="xk_input" name="nationality">
        <svg class="icon" aria-hidden="true" id="gj">
        <use xlink:href="#icon-shujuzidian"></use>
        </svg> 
        <span>民族：</span><input type="text" id="mz_val" key="" readonly="readonly" style="width: 8%;" class="xk_input" name="folk">
        <svg class="icon" aria-hidden="true" id="mz">
        <use xlink:href="#icon-shujuzidian"></use>
       </svg> 
      </td> 
     </tr>
     <tr>
       <td style="height: 28px;" colspan="5"><span style="margin-left: 10px;">户籍地区划：</span>
        <input style="width: 12%;" type="text" class="xk_input" id="hjdqh_val" key="" readonly="readonly" name="nativePlaceRegionalism">
        <svg class="icon" aria-hidden="true" id="hjdqh">
        <use xlink:href="#icon-shujuzidian"></use>
        </svg>
        <span>户籍地详址：</span><input type="text" class="xk_input" name="nativePlace" style="width: 56%;">
       </td> 
     </tr>
     <tr>
       <td style="height: 28px;" colspan="5"><span style="margin-left: 10px;">现住址区划：</span>
        <input style="width: 12%;" type="text" class="xk_input" id="xzzqh_val" key="" readonly="readonly" name="addressRegionalism">
        <svg class="icon" aria-hidden="true" id="xzzqh">
        <use xlink:href="#icon-shujuzidian"></use>
        </svg>
        <span>现住址详址：</span><input type="text" class="xk_input" name="address" style="width: 56%;">
       </td> 
     </tr>
     <tr>
       <td colspan="5"><span style="margin-left: 10px;">服务处所：</span><input type="text" class="xk_input" name="organization" style="width: 90%;"></td>
     </tr>
     <tr>
      <td class="xk_label">体表特殊标记</td>
      <td style="width: 25%;">
       <input type="text" class="xk_input" id="tbtsbj_val" key="" readonly="readonly" name="specialSign" style="width: 90%;">
       <svg class="icon" aria-hidden="true" id="tbtsbj">
        <use xlink:href="#icon-shujuzidian"></use>
       </svg>
      </td>
      <td colspan="4"></td>
     </tr>
     <tr>
      <td class="xk_label_textarea">尸体姿态<font>*</font></td>
      <td colspan="5"><textarea type="text" class="xk_input_textarea" name="gesture"></textarea></td>
     </tr>
     <tr>
      <td class="xk_label_textarea">尸体发现地点<font>*</font></td>
      <td colspan="5"><textarea type="text" class="xk_input_textarea" name="stfxddqk"></textarea></td>
     </tr>
     <tr>
      <td class="xk_label_textarea">尸体位置<font>*</font></td>
      <td colspan="5"><textarea type="text" class="xk_input_textarea" name="stwz"></textarea></td>
     </tr>
     <tr>
      <td class="xk_label_textarea">现场血迹情况</td>
      <td colspan="5"><textarea type="text" class="xk_input_textarea" name="xcxjqk"></textarea></td>
     </tr>
     <tr>
      <td class="xk_label_textarea">现场周围环境概况<font>*</font></td>
      <td colspan="5"><textarea type="text" class="xk_input_textarea" name="xczwhjgk"></textarea></td>
     </tr>
     <tr>
      <td class="xk_label_textarea">衣着情况<font>*</font></td>
      <td colspan="5"><textarea type="text" class="xk_input_textarea" name="clothes"></textarea></td>
     </tr>
     <tr>
      <td class="xk_label_textarea">随身物品</td>
      <td colspan="5"><textarea type="text" class="xk_input_textarea" name="takenWith"></textarea></td>
     </tr>
     <tr>
      <td class="xk_label_textarea">盛装物名称</td>
      <td colspan="5"><textarea type="text" class="xk_input_textarea" name=""></textarea></td>
     </tr>
     <tr>
      <td class="xk_label_textarea">包裹物名称</td>
      <td colspan="5"><textarea type="text" class="xk_input_textarea" name=""></textarea></td>
     </tr>
     <tr>
      <td class="xk_label">家属是否通意解剖</td>
      <td style="width: 25%;">
        <select class="xk_input" name="familyComment" style="width: 90%;">
         <option value="1" selected="selected">是</option>
         <option value="2">否</option>
        </select>
      </td>
      <td colspan="4"></td>
     </tr>
     <tr>
       <td class="xk_label">尸检报告</td>
       <td><input type="file" class="xk_input" name="" style="width: 90%;"></td>
       <td colspan="4"></td>
     </tr>
     <tr>
      <td class="xk_label_textarea">备注</td>
      <td colspan="5"><textarea type="text" class="xk_input_textarea" name="remark"></textarea></td>
     </tr>
   </table>
   <div class="column"><span class="current">尸检分析意见</span></div>
   <table class="xk_table">
    <tr>
      <td class="xk_label">死亡时间推断(起)<font>*</font></td>
      <td style="width: 25%;">
       <input type="text" class="xk_input" name="deathDateFrom" style="width: 90%;">
      </td>
      <td class="xk_label">死亡时间推断(止)<font>*</font></td>
      <td style="width: 25%;">
       <input type="text" class="xk_input" name="deathDateTo" style="width: 90%;">
      </td>
      <td colspan="2"></td>
    </tr>
    <tr>
      <td class="xk_label">致死原因<font>*</font></td>
      <td style="width: 25%;">
       <input type="text" class="xk_input" name="deathReason" id="zsyy_val" key="" readonly="readonly" style="width: 90%;">
       <svg class="icon" aria-hidden="true" id="zsyy">
        <use xlink:href="#icon-shujuzidian"></use>
       </svg>
      </td>
      <td class="xk_label">死亡性质<font>*</font></td>
      <td style="width: 25%;">
       <input type="text" class="xk_input" name="deathProperty" id="swxz_val" key="" readonly="readonly" style="width: 90%;">
       <svg class="icon" aria-hidden="true" id="swxz">
        <use xlink:href="#icon-shujuzidian"></use>
       </svg>
      </td>
      <td colspan="2"></td>
    </tr>
    <tr>
      <td class="xk_label_textarea">加害形式<font>*</font></td>
      <td colspan="5"><textarea type="text" class="xk_input_textarea" name="inflictManner"></textarea></td>
     </tr>
     <tr>
      <td class="xk_label_textarea">缢勒颈方式</td>
      <td colspan="5"><textarea type="text" class="xk_input_textarea" name="strangleholdManner"></textarea></td>
     </tr>
     <tr>
      <td class="xk_label_textarea">窒息症状</td>
      <td colspan="5"><textarea type="text" class="xk_input_textarea" name="chokeSymptom"></textarea></td>
     </tr>
     <tr>
      <td class="xk_label_textarea">尸表检验意见</td>
      <td colspan="5"><textarea type="text" class="xk_input_textarea" name="surfaceExamOpinion"></textarea></td>
     </tr>  
   </table>
  </form>
  </div>  
 </div>
 <!-- 检验人树 -->
<div id="div_jyr_tree" class="easyui-dialog" closed="true">
 <div>
  <input type="text" class="xk_input96" readonly="readonly" name="" parentKey="" childKey="" key="" id="jyr_vals" style="margin-left: 1%;">
  <ww:hidden name="itemskeybox" id="selectedKeys"/>
 </div> 
 <ul id="jyr_tree" style="width: 50%;float: left;margin-top: 1px;"></ul>
 <ul style="width: 50%;float: right;margin-top: 4px;" id="ul_jyr_chanyong">
   <li key="0">常用项</li>
 </ul>
</div>
<!-- 国籍树 -->
<div id="div_gj_tree" class="easyui-dialog" closed="true">
 <ul id="gj_tree" style="width: 50%;float: left;margin-top: 1px;"></ul>
 <ul style="width: 50%;float: right;margin-top: 4px;" id="ul_gj_chanyong">
   <li key="0">常用项</li>
 </ul>
</div>
<!-- 民族树 -->
<div id="div_mz_tree" class="easyui-dialog" closed="true">
 <ul id="mz_tree" style="width: 50%;float: left;margin-top: 1px;"></ul>
 <ul style="width: 50%;float: right;margin-top: 4px;" id="ul_mz_chanyong">
   <li key="0">常用项</li>
 </ul>
</div>
<!-- 户籍地区划树 -->
<div id="div_hjdqh_tree" class="easyui-dialog" closed="true">
 <ul id="hjdqh_tree" style="width: 50%;float: left;margin-top: 1px;"></ul>
 <ul style="width: 50%;float: right;margin-top: 4px;" id="ul_hjdqh_chanyong">
   <li key="0">常用项</li>
 </ul>
</div>
<!-- 现住址区划树 -->
<div id="div_xzzqh_tree" class="easyui-dialog" closed="true">
 <ul id="xzzqh_tree" style="width: 50%;float: left;margin-top: 1px;"></ul>
 <ul style="width: 50%;float: right;margin-top: 4px;" id="ul_xzzqh_chanyong">
   <li key="0">常用项</li>
 </ul>
</div>
 <!-- 体表特殊标记树 -->
<div id="div_tbtsbj_tree" class="easyui-dialog" closed="true">
 <div>
  <input type="text" class="xk_input96" readonly="readonly" name="" parentKey="" childKey="" key="" id="tbtsbj_vals" style="margin-left: 1%;">
  <ww:hidden name="itemskeybox" id="selectedKeys"/>
 </div> 
 <ul id="tbtsbj_tree" style="width: 50%;float: left;margin-top: 1px;"></ul>
 <ul style="width: 50%;float: right;margin-top: 4px;" id="ul_tbtsbj_chanyong">
   <li key="0">常用项</li>
 </ul>
</div>
 <!-- 致死原因树 -->
<div id="div_zsyy_tree" class="easyui-dialog" closed="true">
 <ul id="zsyy_tree" style="width: 50%;float: left;margin-top: 1px;"></ul>
 <ul style="width: 50%;float: right;margin-top: 4px;" id="ul_zsyy_chanyong">
   <li key="0">常用项</li>
 </ul>
</div>
 <!-- 死亡性质树 -->
<div id="div_swxz_tree" class="easyui-dialog" closed="true">
 <ul id="swxz_tree" style="width: 50%;float: left;margin-top: 1px;"></ul>
 <ul style="width: 50%;float: right;margin-top: 4px;" id="ul_swxz_chanyong">
   <li key="0">常用项</li>
 </ul>
</div>        
</body>
<script type="text/javascript" src="jquery-easyui-1.5.3/jquery.min.js"></script>
<script type="text/javascript" src="jquery-easyui-1.5.3/jquery.easyui.min.js"></script>
<script type="text/javascript">
 var x = $(".xk_submit").height();
 $(".content").css('margin-bottom',x); 
 $("input[name='wmst']").change(function(){
   var val=$(this).attr("value");
  if(val=="2"){
      $("#wmst").attr("style","");
    }else{
      $("#wmst").attr("style","display: none");
    }
})
$("#a_bian li:eq(0)").css("color","red");
var jyr_my_array = new Array();
var jyr_value_array = new Array();
var jyr_changyong_vals = new Array();
var jyr_cy_prarent_vals = new Array();
jyr_i = 0;
jyr_j = 0;
jyr_cy_i = 0;
jyr_cy_j = 0;
var jyr_parentValue = "";
var jyr_value = "";
var jyr_key = "";
//对于重复选择的值,不保存
function jyr_RecHasThe(s){
  for (i = 0; i < jyr_my_array.length; i++)
   {
     if( jyr_my_array[i] == s)      return false;     
   }
  return true;
}

$("#jyr").click(function(){
  $("#div_jyr_tree").dialog({
  title:"检验人多选字典",
  width:"1200px",
  height:"600px",
  closed: false,
  buttons:[
  {
    text:"提交",
    iconCls:"icon-save",
    handler:function(){
      var val = $("#jyr_vals").val();
      $("#jyr_val").val(val);
      $("#div_jyr_tree").dialog("close");
    }
  },
  {
  text:"清空",
  iconCls:"icon-redo",
  handler:function(){
    jyr_my_array = [];
    jyr_value_array= [];
    jyr_changyong_vals= [];
    jyr_cy_prarent_vals= [];
    jyr_i = 0;
    jyr_j = 0;
    jyr_cy_i = 0;
    jyr_cy_j = 0;
    $("#jyr_vals").val("");;
  }
  },{
  text:"设为常用",
  iconCls:"icon-large-smartart",
  handler:function(){
    if(jyr_parentValue != null && jyr_parentValue.length != 0){
      if (jyr_value != null && jyr_value.length!= 0){
        for(var i = 0;i<=jyr_changyong_vals.length;i++){
          if(jyr_changyong_vals.indexOf(jyr_value) != -1){
            return false;
          }else{
            jyr_changyong_vals[jyr_cy_i++] = jyr_value;
            for(var c = 0;c<=jyr_cy_prarent_vals.length;c++){
              if(jyr_cy_prarent_vals[c] == jyr_parentValue){
                break;
              }else{
                jyr_cy_prarent_vals[jyr_cy_j++] = jyr_parentValue;
                break;
              }
            }
            $("#ul_jyr_chanyong").append("<li key='"+jyr_key+"' parentValue="+jyr_parentValue+" onclick='jyr_changyong_val(this)'><button class='easyui-linkbutton' onclick='jyr_changyong_del(this)' type='button' iconCls='icon-no'></button>"+
            "<a href='javascript:;'>"+jyr_value+"</a></li>");
            $.parser.parse("#ul_jyr_chanyong");
          }
        }
      }
    }
  }
 }
 ],
 });  
//检验人树
$("#jyr_tree").tree({
  url:'json/xczhry_tree.json',
    method:"get",
  onLoadSuccess:function(){  
   $("#jyr_tree").tree("collapseAll");  
  },
  onDblClick: function(node){
  if($('#jyr_tree').tree('isLeaf',node.target)){
      jyr_parentValue = $('#jyr_tree').tree("getParent",node.target).text;
      jyr_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      jyr_key = node.id;

  if(jyr_RecHasThe(jyr_value)){  
     if (jyr_value != "") {
        jyr_my_array[jyr_i++] = jyr_value;
        if (jyr_parentValue == null || jyr_parentValue == "") {
            jyr_value_array[jyr_j++] = jyr_value;
        } else {
            if (jyr_j == 0) {
                jyr_value_array[jyr_j++] = jyr_parentValue + "：" + jyr_value;
            } else {
                var flag = false;
                for (var k = 0; k < jyr_value_array.length; k++) {
                    var tempValue = jyr_value_array[k];
                    if (tempValue.indexOf(jyr_parentValue) != -1) {
                        jyr_value_array[k] = jyr_value_array[k] + "、" + jyr_value;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) jyr_value_array[jyr_j++] = jyr_parentValue + "：" + jyr_value;
            }
        }
        var totalvalue = jyr_value_array.join("，");
         $("#jyr_vals").val(totalvalue);;
    }
  }
  }
 },
 onClick: function(node){
   if($('#jyr_tree').tree('isLeaf',node.target)){
     jyr_parentValue = $('#jyr_tree').tree("getParent",node.target).text;
      jyr_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      jyr_key = node.id;

  }
 }
});
$('#div_jyr_tree').dialog('open'); //打开添加对话框
$('#div_jyr_tree').window('center');//使Dialog居中显示  
}); 
//删除检验人常用项
function jyr_changyong_del(obj){
 $.messager.confirm("操作提示","确定要删除该常用项吗？",function (data){
  if(data){
   var val = obj.nextSibling.innerText;
   for(var i = 0;i<jyr_changyong_vals.length;i++){
    if(jyr_changyong_vals[i] == val){
      jyr_changyong_vals.splice(i,1);
    }
   }
   obj.parentNode.remove();
  }
 });
}
//给检验人框赋选定常用值
function jyr_changyong_val(obj){
  var val_val = obj.attributes.parentvalue.value;
  var val = obj.childNodes[1].innerText;
   if(jyr_RecHasThe(val)){  
     if (val != "") {
        jyr_my_array[jyr_i++] = val;
        if (val_val == null || val_val == "") {
            jyr_value_array[jyr_j++] = val;
        } else {
            if (jyr_j == 0) {
                jyr_value_array[jyr_j++] = val_val + "：" + val;
            } else {
                var flag = false;
                for (var k = 0; k < jyr_value_array.length; k++) {
                    var tempValue = jyr_value_array[k];
                    if (tempValue.indexOf(val_val) != -1) {
                        jyr_value_array[k] = jyr_value_array[k] + "、" + val;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) jyr_value_array[jyr_j++] = val_val + "：" + val;
            }
        }
        var totalvalue = jyr_value_array.join("，");
         $("#jyr_vals").val(totalvalue);;
    }
  }
}
var gj_val;
$("#gj").click(function(){
 $("#div_gj_tree").dialog({
  title:"国籍单选字典",
  width:"700px",
  height:"400px",
  closed: false,
  buttons:[
  {
  text:"选择空值",
  iconCls:"icon-redo",
  handler:function(){
   $("#gj_val").val("");
   $("#div_gj_tree").dialog("close");
  }
  },{
  text:"设为常用",
  iconCls:"icon-save",
  handler:function(){
    if(gj_node != null && gj_node.length != 0){
      var li_num = $("#ul_gj_chanyong li").length
      var lis = "";
      for(var i = 0;i<li_num;i++){
        lis += $("#ul_gj_chanyong li:eq("+i+")").attr("key");
      }
      var gj_Id = gj_id.toString();
       if(lis.indexOf(gj_Id) < 0){
       $("#ul_gj_chanyong").append("<li key='"+gj_id+"' ondblclick='gj_changyong_val(this)'><button class='easyui-linkbutton' onclick='gj_changyong_del(this)' type='button' iconCls='icon-no'></button>"+
        "<a href='javascript:;'>"+gj_node+"</a></li>");
        $.parser.parse("#ul_gj_chanyong");
     }
    }
  }
  }
  ],
 });
 $('#div_gj_tree').dialog('open'); //打开添加对话框
$('#div_gj_tree').window('center');//使Dialog居中显示
});
//国籍树
var gj_node;
var gj_id;
$("#gj_tree").tree({
  url:'json/gj_tree.json',
    method:"get",
  onLoadSuccess:function(){  
   $("#gj_tree").tree("collapseAll");  
  },
  onDblClick: function(node){
  if($('#gj_tree').tree('isLeaf',node.target)){
     $("#gj_val").val(node.text);
     $("#gj_val").attr("key",node.id);
     $("#div_gj_tree").dialog("close");
  }
 },
 onClick: function(node){
   if($('#gj_tree').tree('isLeaf',node.target)){
      gj_node = node.text;
      gj_id = node.id;
  }
 }
});
//删除国籍常用项
function gj_changyong_del(obj){
 $.messager.confirm("操作提示","确定要删除该常用项吗？",function (data){
  if(data){
   obj.parentNode.remove();
  }
 });
}
//给国籍框赋选定常用值
function gj_changyong_val(obj){
 $("#gj_val").val(obj.innerText);
 $("#gj_val").attr("key",obj.attributes.key.value);
 $("#div_gj_tree").dialog("close");
}
var mz_val;
$("#mz").click(function(){
 $("#div_mz_tree").dialog({
  title:"民族单选字典",
  width:"700px",
  height:"400px",
  closed: false,
  buttons:[
  {
  text:"选择空值",
  iconCls:"icon-redo",
  handler:function(){
   $("#mz_val").val("");
   $("#div_mz_tree").dialog("close");
  }
  },{
  text:"设为常用",
  iconCls:"icon-save",
  handler:function(){
    if(mz_node != null && mz_node.length != 0){
      var li_num = $("#ul_mz_chanyong li").length
      var lis = "";
      for(var i = 0;i<li_num;i++){
        lis += $("#ul_mz_chanyong li:eq("+i+")").attr("key");
      }
      var mz_Id = mz_id.toString();
       if(lis.indexOf(mz_Id) < 0){
       $("#ul_mz_chanyong").append("<li key='"+mz_id+"' ondblclick='mz_changyong_val(this)'><button class='easyui-linkbutton' onclick='mz_changyong_del(this)' type='button' iconCls='icon-no'></button>"+
        "<a href='javascript:;'>"+mz_node+"</a></li>");
        $.parser.parse("#ul_mz_chanyong");
     }
    }
  }
  }
  ],
 });
 $('#div_mz_tree').dialog('open'); //打开添加对话框
$('#div_mz_tree').window('center');//使Dialog居中显示
});
//民族树
var mz_node;
var mz_id;
$("#mz_tree").tree({
  url:'json/mz_tree.json',
    method:"get",
  onLoadSuccess:function(){  
   $("#mz_tree").tree("collapseAll");  
  },
  onDblClick: function(node){
  if($('#mz_tree').tree('isLeaf',node.target)){
     $("#mz_val").val(node.text);
     $("#mz_val").attr("key",node.id);
     $("#div_mz_tree").dialog("close");
  }
 },
 onClick: function(node){
   if($('#mz_tree').tree('isLeaf',node.target)){
      mz_node = node.text;
      mz_id = node.id;
  }
 }
});
//删除民族常用项
function mz_changyong_del(obj){
 $.messager.confirm("操作提示","确定要删除该常用项吗？",function (data){
  if(data){
   obj.parentNode.remove();
  }
 });
}
//给民族框赋选定常用值
function mz_changyong_val(obj){
 $("#mz_val").val(obj.innerText);
 $("#mz_val").attr("key",obj.attributes.key.value);
 $("#div_mz_tree").dialog("close");
}
var hjdqh_val;
$("#hjdqh").click(function(){
 $("#div_hjdqh_tree").dialog({
  title:"户籍地区划单选字典",
  width:"700px",
  height:"400px",
  closed: false,
  buttons:[
  {
  text:"选择空值",
  iconCls:"icon-redo",
  handler:function(){
   $("#hjdqh_val").val("");
   $("#div_hjdqh_tree").dialog("close");
  }
  },{
  text:"设为常用",
  iconCls:"icon-save",
  handler:function(){
    if(hjdqh_node != null && hjdqh_node.length != 0){
      var li_num = $("#ul_hjdqh_chanyong li").length
      var lis = "";
      for(var i = 0;i<li_num;i++){
        lis += $("#ul_hjdqh_chanyong li:eq("+i+")").attr("key");
      }
      var hjdqh_Id = hjdqh_id.toString();
       if(lis.indexOf(hjdqh_Id) < 0){
       $("#ul_hjdqh_chanyong").append("<li key='"+hjdqh_id+"' ondblclick='hjdqh_changyong_val(this)'><button class='easyui-linkbutton' onclick='hjdqh_changyong_del(this)' type='button' iconCls='icon-no'></button>"+
        "<a href='javascript:;'>"+hjdqh_node+"</a></li>");
        $.parser.parse("#ul_hjdqh_chanyong");
     }
    }
  }
  }
  ],
 });
 $('#div_hjdqh_tree').dialog('open'); //打开添加对话框
$('#div_hjdqh_tree').window('center');//使Dialog居中显示
});
//户籍地区划树
var hjdqh_node;
var hjdqh_id;
$("#hjdqh_tree").tree({
  url:'json/hjdqh_tree.json',
    method:"get",
  onLoadSuccess:function(){  
   $("#hjdqh_tree").tree("collapseAll");  
  },
  onDblClick: function(node){
  if($('#hjdqh_tree').tree('isLeaf',node.target)){
     $("#hjdqh_val").val(node.text);
     $("#hjdqh_val").attr("key",node.id);
     $("#div_hjdqh_tree").dialog("close");
  }
 },
 onClick: function(node){
   if($('#hjdqh_tree').tree('isLeaf',node.target)){
      hjdqh_node = node.text;
      hjdqh_id = node.id;
  }
 }
});
//删除户籍地区划常用项
function hjdqh_changyong_del(obj){
 $.messager.confirm("操作提示","确定要删除该常用项吗？",function (data){
  if(data){
   obj.parentNode.remove();
  }
 });
}
//给户籍地区划框赋选定常用值
function hjdqh_changyong_val(obj){
 $("#hjdqh_val").val(obj.innerText);
 $("#hjdqh_val").attr("key",obj.attributes.key.value);
 $("#div_hjdqh_tree").dialog("close");
}
var xzzqh_val;
$("#xzzqh").click(function(){
 $("#div_xzzqh_tree").dialog({
  title:"现住址区划单选字典",
  width:"700px",
  height:"400px",
  closed: false,
  buttons:[
  {
  text:"选择空值",
  iconCls:"icon-redo",
  handler:function(){
   $("#xzzqh_val").val("");
   $("#div_xzzqh_tree").dialog("close");
  }
  },{
  text:"设为常用",
  iconCls:"icon-save",
  handler:function(){
    if(xzzqh_node != null && xzzqh_node.length != 0){
      var li_num = $("#ul_xzzqh_chanyong li").length
      var lis = "";
      for(var i = 0;i<li_num;i++){
        lis += $("#ul_xzzqh_chanyong li:eq("+i+")").attr("key");
      }
      var xzzqh_Id = xzzqh_id.toString();
       if(lis.indexOf(xzzqh_Id) < 0){
       $("#ul_xzzqh_chanyong").append("<li key='"+xzzqh_id+"' ondblclick='xzzqh_changyong_val(this)'><button class='easyui-linkbutton' onclick='xzzqh_changyong_del(this)' type='button' iconCls='icon-no'></button>"+
        "<a href='javascript:;'>"+xzzqh_node+"</a></li>");
        $.parser.parse("#ul_xzzqh_chanyong");
     }
    }
  }
  }
  ],
 });
 $('#div_xzzqh_tree').dialog('open'); //打开添加对话框
$('#div_xzzqh_tree').window('center');//使Dialog居中显示
});
//现住址区划树
var xzzqh_node;
var xzzqh_id;
$("#xzzqh_tree").tree({
  url:'json/hjdqh_tree.json',
    method:"get",
  onLoadSuccess:function(){  
   $("#xzzqh_tree").tree("collapseAll");  
  },
  onDblClick: function(node){
  if($('#xzzqh_tree').tree('isLeaf',node.target)){
     $("#xzzqh_val").val(node.text);
     $("#xzzqh_val").attr("key",node.id);
     $("#div_xzzqh_tree").dialog("close");
  }
 },
 onClick: function(node){
   if($('#xzzqh_tree').tree('isLeaf',node.target)){
      xzzqh_node = node.text;
      xzzqh_id = node.id;
  }
 }
});
//删除现住址区划常用项
function xzzqh_changyong_del(obj){
 $.messager.confirm("操作提示","确定要删除该常用项吗？",function (data){
  if(data){
   obj.parentNode.remove();
  }
 });
}
//给现住址区划框赋选定常用值
function xzzqh_changyong_val(obj){
 $("#xzzqh_val").val(obj.innerText);
 $("#xzzqh_val").attr("key",obj.attributes.key.value);
 $("#div_xzzqh_tree").dialog("close");
}
var tbtsbj_my_array = new Array();
var tbtsbj_value_array = new Array();
var tbtsbj_changyong_vals = new Array();
var tbtsbj_cy_prarent_vals = new Array();
tbtsbj_i = 0;
tbtsbj_j = 0;
tbtsbj_cy_i = 0;
tbtsbj_cy_j = 0;
var tbtsbj_parentValue = "";
var tbtsbj_value = "";
var tbtsbj_key = "";
//对于重复选择的值,不保存
function tbtsbj_RecHasThe(s){
  for (i = 0; i < tbtsbj_my_array.length; i++)
   {
     if( tbtsbj_my_array[i] == s)      return false;     
   }
  return true;
}

$("#tbtsbj").click(function(){
  $("#div_tbtsbj_tree").dialog({
  title:"体表特殊标记多选字典",
  width:"1200px",
  height:"600px",
  closed: false,
  buttons:[
  {
    text:"提交",
    iconCls:"icon-save",
    handler:function(){
      var val = $("#tbtsbj_vals").val();
      $("#tbtsbj_val").val(val);
      $("#div_tbtsbj_tree").dialog("close");
    }
  },
  {
  text:"清空",
  iconCls:"icon-redo",
  handler:function(){
    tbtsbj_my_array = [];
    tbtsbj_value_array= [];
    tbtsbj_changyong_vals= [];
    tbtsbj_cy_prarent_vals= [];
    tbtsbj_i = 0;
    tbtsbj_j = 0;
    tbtsbj_cy_i = 0;
    tbtsbj_cy_j = 0;
    $("#tbtsbj_vals").val("");;
  }
  },{
  text:"设为常用",
  iconCls:"icon-large-smartart",
  handler:function(){
    if(tbtsbj_parentValue != null && tbtsbj_parentValue.length != 0){
      if (tbtsbj_value != null && tbtsbj_value.length!= 0){
        for(var i = 0;i<=tbtsbj_changyong_vals.length;i++){
          if(tbtsbj_changyong_vals.indexOf(tbtsbj_value) != -1){
            return false;
          }else{
            tbtsbj_changyong_vals[tbtsbj_cy_i++] = tbtsbj_value;
            for(var c = 0;c<=tbtsbj_cy_prarent_vals.length;c++){
              if(tbtsbj_cy_prarent_vals[c] == tbtsbj_parentValue){
                break;
              }else{
                tbtsbj_cy_prarent_vals[tbtsbj_cy_j++] = tbtsbj_parentValue;
                break;
              }
            }
            $("#ul_tbtsbj_chanyong").append("<li key='"+tbtsbj_key+"' parentValue="+tbtsbj_parentValue+" onclick='tbtsbj_changyong_val(this)'><button class='easyui-linkbutton' onclick='tbtsbj_changyong_del(this)' type='button' iconCls='icon-no'></button>"+
            "<a href='javascript:;'>"+tbtsbj_value+"</a></li>");
            $.parser.parse("#ul_tbtsbj_chanyong");
          }
        }
      }
    }
  }
 }
 ],
 });  
//体表特殊标记树
$("#tbtsbj_tree").tree({
  url:'json/tbtsbj_tree.json',
    method:"get",
  onLoadSuccess:function(){  
   $("#tbtsbj_tree").tree("collapseAll");  
  },
  onDblClick: function(node){
  if($('#tbtsbj_tree').tree('isLeaf',node.target)){
      tbtsbj_parentValue = $('#tbtsbj_tree').tree("getParent",node.target).text;
      tbtsbj_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      tbtsbj_key = node.id;

  if(tbtsbj_RecHasThe(tbtsbj_value)){  
     if (tbtsbj_value != "") {
        tbtsbj_my_array[tbtsbj_i++] = tbtsbj_value;
        if (tbtsbj_parentValue == null || tbtsbj_parentValue == "") {
            tbtsbj_value_array[tbtsbj_j++] = tbtsbj_value;
        } else {
            if (tbtsbj_j == 0) {
                tbtsbj_value_array[tbtsbj_j++] = tbtsbj_parentValue + "：" + tbtsbj_value;
            } else {
                var flag = false;
                for (var k = 0; k < tbtsbj_value_array.length; k++) {
                    var tempValue = tbtsbj_value_array[k];
                    if (tempValue.indexOf(tbtsbj_parentValue) != -1) {
                        tbtsbj_value_array[k] = tbtsbj_value_array[k] + "、" + tbtsbj_value;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) tbtsbj_value_array[tbtsbj_j++] = tbtsbj_parentValue + "：" + tbtsbj_value;
            }
        }
        var totalvalue = tbtsbj_value_array.join("，");
         $("#tbtsbj_vals").val(totalvalue);;
    }
  }
  }
 },
 onClick: function(node){
   if($('#tbtsbj_tree').tree('isLeaf',node.target)){
     tbtsbj_parentValue = $('#tbtsbj_tree').tree("getParent",node.target).text;
      tbtsbj_value = node.text;
     //var parentId = $('#ajxz_tree').tree("getParent",node.target).id;
      tbtsbj_key = node.id;

  }
 }
});
$('#div_tbtsbj_tree').dialog('open'); //打开添加对话框
$('#div_tbtsbj_tree').window('center');//使Dialog居中显示  
}); 
//删除体表特殊标记常用项
function tbtsbj_changyong_del(obj){
 $.messager.confirm("操作提示","确定要删除该常用项吗？",function (data){
  if(data){
   var val = obj.nextSibling.innerText;
   for(var i = 0;i<tbtsbj_changyong_vals.length;i++){
    if(tbtsbj_changyong_vals[i] == val){
      tbtsbj_changyong_vals.splice(i,1);
    }
   }
   obj.parentNode.remove();
  }
 });
}
//给体表特殊标记框赋选定常用值
function tbtsbj_changyong_val(obj){
  var val_val = obj.attributes.parentvalue.value;
  var val = obj.childNodes[1].innerText;
   if(tbtsbj_RecHasThe(val)){  
     if (val != "") {
        tbtsbj_my_array[tbtsbj_i++] = val;
        if (val_val == null || val_val == "") {
            tbtsbj_value_array[tbtsbj_j++] = val;
        } else {
            if (tbtsbj_j == 0) {
                tbtsbj_value_array[tbtsbj_j++] = val_val + "：" + val;
            } else {
                var flag = false;
                for (var k = 0; k < tbtsbj_value_array.length; k++) {
                    var tempValue = tbtsbj_value_array[k];
                    if (tempValue.indexOf(val_val) != -1) {
                        tbtsbj_value_array[k] = tbtsbj_value_array[k] + "、" + val;
                        flag = true;
                        break;
                    } 
                }
                if (!flag) tbtsbj_value_array[tbtsbj_j++] = val_val + "：" + val;
            }
        }
        var totalvalue = tbtsbj_value_array.join("，");
         $("#tbtsbj_vals").val(totalvalue);;
    }
  }
}
var zsyy_val;
$("#zsyy").click(function(){
 $("#div_zsyy_tree").dialog({
  title:"致死原因单选字典",
  width:"700px",
  height:"400px",
  closed: false,
  buttons:[
  {
  text:"选择空值",
  iconCls:"icon-redo",
  handler:function(){
   $("#zsyy_val").val("");
   $("#div_zsyy_tree").dialog("close");
  }
  },{
  text:"设为常用",
  iconCls:"icon-save",
  handler:function(){
    if(zsyy_node != null && zsyy_node.length != 0){
      var li_num = $("#ul_zsyy_chanyong li").length
      var lis = "";
      for(var i = 0;i<li_num;i++){
        lis += $("#ul_zsyy_chanyong li:eq("+i+")").attr("key");
      }
      var zsyy_Id = zsyy_id.toString();
       if(lis.indexOf(zsyy_Id) < 0){
       $("#ul_zsyy_chanyong").append("<li key='"+zsyy_id+"' ondblclick='zsyy_changyong_val(this)'><button class='easyui-linkbutton' onclick='zsyy_changyong_del(this)' type='button' iconCls='icon-no'></button>"+
        "<a href='javascript:;'>"+zsyy_node+"</a></li>");
        $.parser.parse("#ul_zsyy_chanyong");
     }
    }
  }
  }
  ],
 });
 $('#div_zsyy_tree').dialog('open'); //打开添加对话框
$('#div_zsyy_tree').window('center');//使Dialog居中显示
});
//国籍树
var zsyy_node;
var zsyy_id;
$("#zsyy_tree").tree({
  url:'json/zsyy_tree.json',
    method:"get",
  onLoadSuccess:function(){  
   $("#zsyy_tree").tree("collapseAll");  
  },
  onDblClick: function(node){
  if($('#zsyy_tree').tree('isLeaf',node.target)){
     $("#zsyy_val").val(node.text);
     $("#zsyy_val").attr("key",node.id);
     $("#div_zsyy_tree").dialog("close");
  }
 },
 onClick: function(node){
   if($('#zsyy_tree').tree('isLeaf',node.target)){
      zsyy_node = node.text;
      zsyy_id = node.id;
  }
 }
});
//删除致死原因常用项
function zsyy_changyong_del(obj){
 $.messager.confirm("操作提示","确定要删除该常用项吗？",function (data){
  if(data){
   obj.parentNode.remove();
  }
 });
}
//给致死原因框赋选定常用值
function zsyy_changyong_val(obj){
 $("#zsyy_val").val(obj.innerText);
 $("#zsyy_val").attr("key",obj.attributes.key.value);
 $("#div_zsyy_tree").dialog("close");
}
var swxz_val;
$("#swxz").click(function(){
 $("#div_swxz_tree").dialog({
  title:"死亡性质单选字典",
  width:"700px",
  height:"400px",
  closed: false,
  buttons:[
  {
  text:"选择空值",
  iconCls:"icon-redo",
  handler:function(){
   $("#swxz_val").val("");
   $("#div_swxz_tree").dialog("close");
  }
  },{
  text:"设为常用",
  iconCls:"icon-save",
  handler:function(){
    if(swxz_node != null && swxz_node.length != 0){
      var li_num = $("#ul_swxz_chanyong li").length
      var lis = "";
      for(var i = 0;i<li_num;i++){
        lis += $("#ul_swxz_chanyong li:eq("+i+")").attr("key");
      }
      var swxz_Id = swxz_id.toString();
       if(lis.indexOf(swxz_Id) < 0){
       $("#ul_swxz_chanyong").append("<li key='"+swxz_id+"' ondblclick='swxz_changyong_val(this)'><button class='easyui-linkbutton' onclick='swxz_changyong_del(this)' type='button' iconCls='icon-no'></button>"+
        "<a href='javascript:;'>"+swxz_node+"</a></li>");
        $.parser.parse("#ul_swxz_chanyong");
     }
    }
  }
  }
  ],
 });
 $('#div_swxz_tree').dialog('open'); //打开添加对话框
$('#div_swxz_tree').window('center');//使Dialog居中显示
});
//死亡性质树
var swxz_node;
var swxz_id;
$("#swxz_tree").tree({
  url:'json/swxz_tree.json',
    method:"get",
  onLoadSuccess:function(){  
   $("#swxz_tree").tree("collapseAll");  
  },
  onDblClick: function(node){
  if($('#swxz_tree').tree('isLeaf',node.target)){
     $("#swxz_val").val(node.text);
     $("#swxz_val").attr("key",node.id);
     $("#div_swxz_tree").dialog("close");
  }
 },
 onClick: function(node){
   if($('#swxz_tree').tree('isLeaf',node.target)){
      swxz_node = node.text;
      swxz_id = node.id;
  }
 }
});
//删除死亡性质常用项
function swxz_changyong_del(obj){
 $.messager.confirm("操作提示","确定要删除该常用项吗？",function (data){
  if(data){
   obj.parentNode.remove();
  }
 });
}
//给死亡性质框赋选定常用值
function swxz_changyong_val(obj){
 $("#swxz_val").val(obj.innerText);
 $("#swxz_val").attr("key",obj.attributes.key.value);
 $("#div_swxz_tree").dialog("close");
}      
</script>
</html>